var CommentCon = iClass.get("Comment");
var BlogCon = iClass("Blog");
iClass.method("User", {
	addCommentToBlog: function(blog_id, comment_info) {
		if (this.isLocking()) {
			Throw("用户被冻结，无法进行增删改操作");
		}
		comment_info.blog_id = blog_id;
		comment_info.commenter_id = this._id;
		comment_info.type = "User";
		var comment = new CommentCon(comment_info);

		midEvent.emit("blog_comment_change", blog_id);
		return comment;
	},
	likeComment: function(comment_id) {
		if (this.isLocking()) {
			Throw("用户被冻结，无法进行增删改操作");
		}
		var comment = CommentCon.get(comment_id);
		if(!comment){
			Throw("找不到指定评价")
		}
		comment._like(this._id);
		return comment;
	},
	unlikeComment: function(comment_id) {
		if (this.isLocking()) {
			Throw("用户被冻结，无法进行增删改操作");
		}
		var comment = CommentCon.get(comment_id);
		if(!comment){
			Throw("找不到指定评价")
		}
		comment._unlike(this._id);
		return comment;
	}
});